package cn.qingyun.gis.modules.school.controller;

import cn.qingyun.gis.common.Result;
import cn.qingyun.gis.modules.init.system.base.controller.BasicController;
import cn.qingyun.gis.modules.school.entity.K12SchoolsInfo;
import cn.qingyun.gis.modules.school.entity.request.FuseCustomerChannelRequest;
import cn.qingyun.gis.modules.school.entity.request.K12SchoolProofreadQueryRequest;
import cn.qingyun.gis.modules.school.entity.request.K12SchoolsProofreadRequest;
import cn.qingyun.gis.modules.school.service.IK12SchoolsFuseCustomerChannelService;
import cn.qingyun.gis.modules.school.service.IK12SchoolsInfoService;
import cn.qingyun.gis.modules.school.service.IK12SchoolsProofreadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * @Description: K12学校摸排调查表表后台管理
 * @Version: V1.0
 */
@Api(tags = "K12学校摸排调查表")
@RestController
@RequestMapping("/app/school")
@Slf4j
public class K12SchoolsProofreadController extends BasicController<K12SchoolsInfo, IK12SchoolsInfoService> {
    @Resource
    private IK12SchoolsProofreadService k12SchoolsProofreadService;

    @Resource
    private IK12SchoolsFuseCustomerChannelService ik12SchoolsFuseCustomerChannelService;

    @PostMapping("/proofread")
    @ApiOperation("K12学校-摸排")
    public Result<?> proofread(@Validated @RequestBody K12SchoolsProofreadRequest request) {
        return Result.okData(k12SchoolsProofreadService.proofread(request));
    }

    @GetMapping("/query")
    @ApiOperation("K12学校未勘误列表查询")
    public Result<?> selectList(@Validated K12SchoolProofreadQueryRequest request) {
        return Result.okData(k12SchoolsProofreadService.queryList(request));
    }


    @GetMapping("/queryTotal")
    @ApiOperation("K12学校勘误列表查询")
    public Result<?> queryTotal(@Validated K12SchoolProofreadQueryRequest request) {
        return Result.okData(k12SchoolsProofreadService.queryTotalList(request));
    }

    @GetMapping("/selectById")
    @ApiOperation("K12学校勘误列表查询")
    public Result<?> queryProofreadById(@Validated String id) {
        return Result.okData(k12SchoolsProofreadService.queryProofreadById(id));
    }

    @PostMapping(value = "/getFuseCustData")
    public Result<?> getLastFuseTableName(@RequestBody @Validated FuseCustomerChannelRequest request) {
        return Result.okData(ik12SchoolsFuseCustomerChannelService.queryFuseCustData(request));
    }

}
